package com.heima.wemedia.controller.v1;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.heima.common.dtos.ResponseResult;
import com.heima.model.media.dtos.WmUserDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heima.wemedia.service.IWmUserService;
import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 自媒体用户信息表 前端控制器
 * </p>
 *
 * @author heima
 * @since 2021-03-13
 */
@RestController
@RequestMapping("/api/v1/wmuser")
@Api(tags = "自媒体用户信息表接口")
@CrossOrigin
public class WmUserController{

    @Autowired
    private IWmUserService wmUserService;

    /**
     * 保存自媒体用户
     */
    @PostMapping("/save")
    public Integer saveWmUser(@RequestBody WmUserDto dto){
       return wmUserService.saveWmUser(dto);
    }
    /**
     * 按照用户id查询用户
     * @param apUserId
     * @return
     */
    @GetMapping("/findByApUserId/{id}")
    public WmUserDto findByApUserId(@PathVariable(name = "id") Integer apUserId) {
        return wmUserService.findByApUserId(apUserId);
    }
}
